<!DOCTYPE html>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <link rel="stylesheet" type="text/css" href="../../css/base.css" />
    <link id="easyuiTheme" rel="stylesheet" type="text/css" href="../../easy-ui/themes/default/easyui.css" rel="stylesheet" />
    <link rel="stylesheet" type="text/css" href="../../easy-ui/themes/icon.css" />
   	<script type="text/javascript" src="../../easy-ui/jquery.min.js"></script>
    <script type="text/javascript" src="../../easy-ui/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="../../js/base.js" ></script>
   
   </head>
   
   
	<body class="easyui-layout" style="overflow:hidden"  fit="true"   scroll="no">
	
	
	<ul id="grid" class="easyui-grid" style="width:100%;" data-options="border:true,
													region:'center',
													fit:true,
													fitColumns:true,
													rownumbers:true,
													singleSelect:false,
													toolbar:'#tb'">
		
	</ul>

	<div id="tb" style="padding:0px;height:auto;overflow:auto;">
	<div style="height:3px;"></div>
			
				<form id="baseForm" name="baseForm" action="" method="post" target="hiddenFrame" style="margin:0px;"> 
					
					<input  name="userId"  id="userId" type="hidden" ></input>
					<input  name="reason"  id="reason" type="hidden" ></input>
					<input  name="minCreateTime"  id="minCreateTime" type="hidden" ></input>
					<input  name="maxCreateTime"  id="maxCreateTime" type="hidden" ></input>
					
						<span style="width:3px;">&nbsp;</span>			
						<!--  <span id="sys_res_A3F041860C844BB5AC2EDFD5DA2E8804" style="display:none">
							<a href='javascript:void(-1);' onclick="addRecord();" class="easyui-linkbutton" iconCls="icon-add" plain="true" >
							新增
							</a>
						</span> 
						<span id="sys_res_184FBF61DDA14E78A915F2250C11BF95" style="display:none">
							<a href='javascript:void(-1);' onclick="updateRecord();" class="easyui-linkbutton" iconCls="icon-edit" plain="true" >
							修改
							</a>
						</span> -->
						<!--<span id="sys_res_1169" >
							<a href='javascript:void(-1);' onclick="deleteRecord();" class="easyui-linkbutton" iconCls="icon-remove" plain="true"  >
							删除
							</a>
					    </span>	-->
					  
						 <span id="search_span_id" >
							<input class="easyui-textbox" id="userName" name="userName" data-options="buttonText:'搜索',buttonIcon:'icon-search',prompt:'请输入搜索关键字',onClickButton:doSearch"
							 style="width:256px;"/>
						 </span>
						 <!-- <a href='javascript:void(-1);' onclick="showSearch();" class="easyui-linkbutton" iconCls="ext-zoom" id="accurate_search_id" title="">精确查找</a> -->
					
				</form> 
				
	<div style="height:3px;"></div>	
	</div>
			
<script type="text/javascript">
	
	var gridId="grid";
	var frameId="create_tabs_iframe_"+getQueryString("frameId");
	var add_window;
	var update_window;
	var view_window;
	var search_window;
	var selections;
	var gridDataUrl='../../zcuserpoint/grid.do?responseFunction=grid';
	
	window.onload = function(){
		var logType =getQueryString('logType');
		if(logType != null && logType !='' && logType != undefined){
			//document.getElementById('logType').value=logType;
		} else{
			var userId = eval('parent.parent.'+getQueryString('targetFrame')+'.mainFrame_id.selections[0].id');
			if(userId != null && userId !='' && userId != undefined){
				document.getElementById('userId').value=userId;
			} 
		}
		initPage();
	}
	
	function initPage(){
	
		parent.showProgressing();
		sendRequestAjax(gridDataUrl,grid);
	}
	
	
	
	
	
	var columns=[[
	{"field":"id","formatter":"","width":158,"title":"","align":"center","checkbox":true,"rowStyler":""},
	{"field":"userName","formatter":"","width":158,"title":"名字","align":"center","checkbox":false,"rowStyler":""},
	{"field":"point","formatter":"","width":158,"title":"积分","align":"center","checkbox":false,"rowStyler":""},
	{"field":"reason","formatter":function(value,rowData,rowIndex){if(rowData.reason=='1'){return '消费积分' } else if(rowData.reason=='2'){return '签到积分' } },"width":158,"title":"积分来源","align":"center","checkbox":false,"rowStyler":""},
	/* {"field":"orderNo","formatter":"","width":158,"title":"订单编号","align":"center","checkbox":false,"rowStyler":""}, */
	{"field":"createTime","formatter":function(value,rowData,rowIndex){ return  switchTime(rowData.createTime,2)},"width":158,"title":"积分时间","align":"center","checkbox":false,"rowStyler":""},
	{"field":"remark","formatter":"","width":158,"title":"备注","align":"center","checkbox":false,"rowStyler":""}
	/* {"field":"updateLastTime","formatter":function(value,rowData,rowIndex){   return  "<a  href='javascript:void(-1);' onclick='viewRecord(\""+rowData.id+"\");'>查看</a>";  },"width":80,"title":"操作","align":"center","checkbox":false,"rowStyler":""} */
	]];
	
	
	
	//初始化数据
     function grid(responseResult){  
		
		 valiAuth(responseResult);
		 $('#grid').datagrid({
	         columns:columns, 
	         pagination:true 
	     }); 
 
 	    loadPageDataCallback(responseResult);  
       
     }
	
	
	
	//重新载入数据
	function reloadPageData(){
	
		parent.showProgressing();
		gridOperate('grid',gridDataUrl,loadPageDataCallback);
		
	}
	
	function reloadPageDataSimple(){
	
		gridOperate('grid',gridDataUrl,loadPageDataCallback);
	
	}
	
	
	
	//初始化数据
     function loadPageDataCallback(responseResult){  
		
			   $('#'+gridId).datagrid("loaded");//不需要显示加载状态   
		       $('#'+gridId).datagrid("loadData",responseResult.data);//将数据绑定到DataGrid中
		
		       setPager('grid',
		       responseResult.data.pageNo,
		       responseResult.data.total,
		       responseResult.data.pageCount,
		       responseResult.data.pageStartOffset,
		       responseResult.data.pageSize,
		       gridDataUrl,
		       grid
		       );
		       
       		   parent.closeProgressing(); 
     }
	
	
	
	
	document.onkeydown = function(evt){
   		 
   		 var evt = window.event?window.event:evt;
   	 if (evt.keyCode==13){
    
    		$("#search_span_id").find(".textbox-button").focus();
    		$("#search_span_id").find(".textbox-button").click();
    		$("#search_span_id").find(".textbox-text").focus();
    		
         }
    }
	
	
	
	$(window).resize(function(){
		
		$('#grid').datagrid('resize', {
			width:document.body.clientWidth,
			height:window.innerHeight,
		});
		
	}); 
	
	
	
	
</script>

</body>
</html>